﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ajax.aspx.cs" Inherits="Web.ajax" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <script type="text/javascript" src="../common/Js/base.js"></script>

    <link href="js/src/tip-yellowsimple/tip-yellowsimple.css" rel="stylesheet" type="text/css" />

    <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="js/src/jquery.poshytip.js" type="text/javascript"></script>

    <script type="text/javascript">

        function test() {
            var ajax = new Ajax("xy012", "&ajax.aspx");

            ajax.onSuccess = function() {
                var strhtml = "";

                if (ajax.state.result == 0 || ajax.state.result == -1) {
                    alert(ajax.state.message);
                } else {



                    strhtml = "<table >";
                    strhtml += "<tr>";
                    strhtml += "<td >时间</td>";
                    strhtml += "<td >关键词</td>";
                    strhtml += "</tr>";


                    for (var i = 0; i < ajax.data.item.length; i++) {
                        strhtml += "<tr>";

                        strhtml += "<td >";
                        strhtml += ajax.data.item[i].datatime;
                        strhtml += "</td>";

                        strhtml += "<td >";
                        strhtml += ajax.data.item[i].keyword;
                        strhtml += "</td>";
                        strhtml += "</tr>";
                    }
                    strhtml += "</table>";




                    $('#getdata').poshytip({
                        content: strhtml, //提示消息
                        className: 'tip-yellowsimple',
                        showTimeout: 1,
                        alignTo: 'target',
                        alignX: 'center',
                        offsetY: 5,
                        allowTipHover: false
                    });

                }

            }
        }
    
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        web!<input type="button" value="测试" onclick="test();" />
        <input type="text" id="getdata" title="" value="" />
    </div>
    </form>
</body>
</html>
